package main.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import main.entity.VoteVO;

@SuppressWarnings("unchecked")
@Repository("voteDAO")
public class VoteDAO extends BaseDAO<VoteVO> {

	public List<?> findVoteByChannel(Integer channelID){
		String queryString = "FROM main.entity.VoteVO vote WHERE vote.chnl_ID="+channelID;
		List<?> list = getHibernateTemplate().find(queryString);
		return list;
	}
	
	public Integer getAllCount(){
		String queryString = "SELECT COUNT(vote.vote_ID) FROM main.entity.VoteVO vote";
		List<?>list = getHibernateTemplate().find(queryString);
		return (Integer) list.get(0);
	}
	
}
